<!DOCTYPE html>
<html>
    <head>
        <?php Yii::app()->getClientScript()->registerCoreScript('jquery'); ?>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <!--<link href="<?php echo $this->assetDir ?>css/bootstrap//bootstrap.css" rel="stylesheet" />-->
        <link href="<?php echo $this->assetDir ?>css/style.css" rel="stylesheet" />
        <link href="<?php echo $this->assetDir ?>css/tab.css" rel="stylesheet" />
        <link href="<?php echo $this->assetDir ?>css/carousel.css" rel="stylesheet" />
        <link href="<?php echo $this->assetDir ?>css/CategoriesMenu.css" rel="stylesheet" />
        <link rel="icon" href="<?php echo $this->assetDir.'image/favicon.ico'?>">
        <!--Slide chan trang-->
        <link href="<?php echo $this->assetDir ?>css/bxslide/jquery.bxslider.css" rel="stylesheet" />
        <script>
            var BASE_URL = '<?php echo baseUrl() ?>';
        </script>
    </head>
    <body>
        <style>
            @font-face {
                font-family: 'Open Sans Condensed';
                font-style: normal;
                font-weight: 700;
                src: url(<?php echo $this->assetDir ?>font/OpenSansCondensed.woff2);
                unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
            }
        </style>
        <header>
            <div class="main-header">
                <div class="main-wrap">
                    <div class="logo-header fl span6">
                        <div class="fl pull-left">
                            <a href="<?php echo Yii::app()->createUrl('site/index') ?>">
                                <?php $_logo = baseUrl().'/'.Option::getItem('logo') ?>
                                <?php $logo = empty($_logo)?$this->assetDir .'img/logo/logo-head.png':$_logo ?>
                                <img src="<?= $logo?>" >
                            </a>
                        </div>
                        <div class="slogan name-title fr pull-right">
                            <?= Option::getItem('site_name') ?>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="menu-header fl">
                        <?php
                        $this->widget('zii.widgets.CMenu', array(
                            'items'       => Menu::getItems(Menu::POS_NAVBAR),
                            'htmlOptions' => array('rel' => "Nofollow"),
//                                    'htmlOptions' => array('class' => 'inline', 'rel' => "Nofollow"),
//                                    'id'          => 'main-menu'
                        ));
                        ?>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </header>
        <div id="header-bottom">
            <div class="main-wrap">
                <div class="menu-product fl">
<!--                    <span class="name-title OpenSan">Danh mục sản phẩm</span>
                    <img src="<?php // echo $this->assetDir . 'img/icon/icon-danhmuc.png' ?>">-->
                    <img src="<?php echo $this->assetDir . 'image/bg/dmsp.png' ?>">
                </div>
                <div id="search_btn" class="fl">
                    <form action="<?php echo url('site/search') ?>">
                        <input type="text" name="key" size="21" placeholder="Nhập từ tìm kiếm..."
                               value="<?php echo isset($_GET['key']) ? $_GET['key'] : '' ?>" id="search_text"/> 
                        <input id="search_button" type="submit" value="">
                    </form>
                    <div class="clear"></div>
                </div>
                <div class="fl">
                    <div class="hotline" >
                        <?php if (Option::getItem('hot-line')): ?>
                            <i>
                                <img class="" style="margin: -4px 0px 0px 0;" src="<?php echo $this->assetDir . 'img/icon/icon-tel.png' ?>"/>
                            </i>
                            <span class="roboto" style="text-shadow: 2px 1px 3px #868282;"><?php echo Option::getItem('hot-line') ?></span>
                        <?php endif; ?>
                    </div>
                    <!--                                <div id="order" class="fl">
                                                        <img src="<?php // echo $this->assetDir . 'img/icon/icon-giohang.png'                       ?>"/>
                                                        0
                                                        |
                                                        <span>
                                                            <a href="<?php // echo Yii::app()->createUrl('order/index')                       ?>">
                                                                0.00 VNĐ
                                                            </a>
                                                        </span>
                                                    </div>-->
                </div>
                <div class="clear"></div>
            </div>

        </div>


        <div class="main-wrap">
            <div id="main-sidebar" class="fl">
                <div id="sidebar-pro">
                    <div id='cssmenu' >
                        <?php
                        $this->widget('zii.widgets.CMenu', array(
                            'items'       => Menu::getItems(Menu::POS_FOOTER_RIGHT),
                            'htmlOptions' => array('class' => '', 'rel' => "Nofollow"),
                            'id'          => 'main-menu'
                        ));
                        ?>
                        <!--                                <ul class="">
                                                            <li class="has-sub"><a class="" href="/mega/thiet-bi-phong-thi-nghiem">Máy hèn que</a>
                                                                <ul>
                                                                    <li><a class="" href="/mega/thiet-bi-co-ban">Thiết bị cơ bản</a></li>
                                                                    <li><a class="" href="/mega/dung-cu-thuy-tinh">Dụng cụ thủy tinh</a></li>
                                                                </ul>
                                                            </li>
                                                            <li class="has-sub"><a class="" href="/mega/thiet-bi-moi-truong">Phụ kiện máy hàn</a>
                                                                <ul>
                                                                    <li class="has-sub"><a class="" href="/mega/xu-ly-nuoc-cap-nuoc-thai">Xử lý nước cấp, nước thải</a>
                                                                        <ul>
                                                                            <li class="has-sub"><a class="" href="/mega/hoa-chat">Máy hàn công nghiệp</a>
                                                                                <ul>
                                                                                    <li><a class="" href="/mega/hcl">Máy nén</a></li>
                                                                                </ul>
                                                                            </li>
                                                                        </ul>
                                                                    </li>
                                                                    <li><a class="" href="/mega/xu-ly-chat-ran">Xử lý chất rắn</a></li>
                                                                    <li><a class="" href="/mega/xu-ly-khong-khi">Xử lý không khí</a></li>
                                                                    <li><a class="" href="/mega/thiet-bi-chuan-bi-mau">Thiết bị chuẩn bị mẫu</a></li>
                                                                </ul>
                                                            </li>
                                                            <li class="has-sub"><a class="" href="/mega/hoa-chat">Máy đo áp</a>
                                                                <ul>
                                                                    <li><a class="" href="/mega/hoa-chat-biomatik">Hóa chất Biomatik</a></li>
                                                                    <li><a class="" href="/mega/hoa-chat-tci">Hóa chất TCI</a></li>
                                                                    <li><a class="" href="/mega/hoa-chat-himedia">Hóa chất Himedia</a></li>
                                                                </ul>
                                                            </li>
                        <?php
//                                    Category::getCateMenu();
                        ?>
                                                        </ul>-->
                    </div>
                </div>
                <div id="new-bar">
                    <div id="ie-test">
                        <ul id="boxLinks" class="group">
                            <li><a href="javascript:void(0)" class="active" target="#box1">Tin mới</a>
                                <div class="caret"></div>
                            </li>
                            <li><a href="javascript:void(0)" target="#box2" class="mozz">Tin đọc nhiều</a>
                                <div class=""></div></li>
                        </ul>
                        <div class="clear"></div>
                        <script>
                            $('#boxLinks li').off('click').click(function (e) {
                                e.stopPropagation();
                                $('#boxLinks li a').removeClass('active');
                                $('#boxLinks li div').removeClass('caret');
                                $('#box').children().slideUp();
                                $(this).children('a').addClass('active');
                                $(this).children('div').addClass('caret');
                                var des = $(this).children().attr('target');
                                if ($(this).index($('#boxLinks li')) == -1)
                                    $(this).children('div').css('left', '102px')
                                $(des).slideDown();
                                return false;
                            });
                        </script>
                        <div id="box">
                            <?php if ($this->new_posts): ?>
                                <div id="box1" class="box">
                                    <?php foreach ($this->new_posts as $v): ?>
                                        <div class="news">
                                            <div class="thumb fl">
                                                <a href="<?= $v->viewUrl ?>">
                                                    <img src="<?php echo $v->thumbnail ?>" alt="<?= $v->title ?>"/>
                                                </a>
                                            </div>
                                            <div class="infor fl">
                                                <a href="<?= $v->viewUrl ?>">
                                                    <?= MyUtil::word_limiter($v->title, 12) ?>
                                                </a>
                                            </div>
                                            <div class="clear"></div>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            <?php endif; ?>
                            <?php if ($this->most_viewed_posts): ?>
                                <div id="box2" class="box hide">
                                    <?php foreach ($this->most_viewed_posts as $v): ?>
                                        <div class="news">
                                            <div class="thumb fl">
                                                <a href="<?= $v->viewUrl ?>">
                                                    <img src="<?php echo $v->thumbnail ?>" alt="<?= $v->title ?>"/>
                                                </a>
                                            </div>
                                            <div class="infor fl">
                                                <a href="<?= $v->viewUrl ?>">
                                                    <?= MyUtil::word_limiter($v->title, 12) ?>
                                                </a>
                                            </div>
                                            <div class="clear"></div>
                                        </div>
                                    <?php endforeach; ?>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main-content fl">
                <?php
                if ($this->breadcrumbs)
                {
                    $homeUrl   = Yii::app()->createUrl("site/index");
                    $img       = $this->assetDir . 'img/icon/icon-home.png';
                    $separator = $this->assetDir . 'img/icon/icon-breadcrumb.png';
                    $name      = " <span><img src='$img'></span> ";
                    $this->widget('zii.widgets.CBreadcrumbs', array(
                        'homeLink'  => CHtml::link($name, $homeUrl),
                        'links'     => $this->breadcrumbs,
                        'separator' => "<span><img src='$separator'></span>",
                    ));
                    echo '<hr>';
                }
                ?>
                <?php echo $content; ?>
            </div>
            <div class="clear"></div>
            <!--SLide chân trang-->
            <?php if ($this->partners): ?>
                <div class="slider4">
                    <?php foreach ($this->partners as $v): ?>
                        <div class="slide"><img src="<?php echo $v->picture ?>" title="<?= $v->name ?>"></div>
                    <?php endforeach; ?>
                </div>
            <?php endif; ?>
        </div>
        <footer>
            <div id="main-footer">
                <div class="main-wrap">
                    <div class="">
                        <div class="name-footer fl span5">
                            <h1>
                                <?php echo Option::getItem('site_name') ?>
                            </h1>
                            <div>
                                <?php echo Option::getItem('address') ?>
                            </div>
                            <div>
                                <span>
                                    <?php echo Option::getItem('phone') ?>
                                </span> 
                                <br>
                                <span>
                                    <?php echo Option::getItem('fax') ?>
                                </span> 
                            </div>
                            <!--                                <div>
                                                                dienluc@gmail.com
                            <?php // echo Option::getItem('email') ?>
                                                            </div>-->

                        </div>

                        <!--                        <div class="menu-footer fl">
                        
                        <?php
//                            $this->widget('zii.widgets.CMenu', array(
//                                'items'       => Menu::getItems(Menu::POS_FOOTER_LEFT),
//                                'htmlOptions' => array('class' => 'nav nav-horizontal', 'rel' => "Nofollow"),
//                                'id'          => 'main-menu'
//                            ));
                        ?>
                        
                                                </div>-->

                        <div class="menu-footer fl span3">
                            <?php
                            $this->widget('zii.widgets.CMenu', array(
                                'items'       => Menu::getItems(Menu::POS_FOOTER_RIGHT),
                                'htmlOptions' => array('class' => 'nav-horizontal'),
                                'id'          => 'main-menu'
                            ));
                            ?>
                        </div>

                        <div class="infor-footer fr">
                            <div style="color: #BB0101; font-weight: 600; padding-bottom: 6px;">
                                Đăng ký nhận bản tin qua email
                            </div>

                            <?php
                            cs()->registerScriptFile($this->assetDir . 'js/jquery.pnotify.min.js');
                            cs()->registerCssFile($this->assetDir . 'css/jquery.pnotify.default.css');
                            $subsModel = new Subscription();
                            $form      = $this->beginWidget('CActiveForm', array(
                                'id'                   => 'subscription-form',
                                'action'               => null,
                                // Please note: When you enable ajax validation, make sure the corresponding
                                // controller action is handling ajax validation correctly.
                                // There is a call to performAjaxValidation() commented in generated controller code.
                                // See class documentation of CActiveForm for details on this.
                                'enableAjaxValidation' => true,
                                //'enableClientValidation'=>false,
                                'clientOptions'        => array(
                                    'validateOnSubmit' => true,
                                    'validateOnType'   => false,
                                ),
                                'htmlOptions'          => array(
                                    'class' => 'subscrible-form',
                                ),
                            ));
                            ?>
                            <div class="input-append">
                                <?php echo CHtml::textField('sub_email', '', array('class' => 'span8 input-sub')); ?>
                                <?php echo CHtml::submitButton('Đăng ký', array('class' => "btn-subscribe", 'onclick' => 'subscribe()')); ?>
                            </div>
                            <?php $this->endWidget() ?>
                            <div class="share-footer">
                                Theo dõi MBT trên mạng xã hội
                                <a target="_blank" title="Facebook" href="<?php echo Option::getItem('facebook') ?>">
                                    <img src="<?php echo $this->assetDir . 'img/icon/facebook.png' ?>">
                                </a>
                                <a target="_blank" href="<?php echo Option::getItem('g_plus') ?>" title="Google+">
                                    <img src="<?php echo $this->assetDir . 'img/icon/gplus.png' ?>">
                                </a>
                                <a target="_blank" href="<?php echo Option::getItem('twitter') ?>" title="Google+">
                                    <img src="<?php echo $this->assetDir . 'img/icon/twitter.png' ?>">
                                </a>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <div class="main-wrap">
                    <div class="ft-menu fl">
                        <?php
                        $this->widget('zii.widgets.CMenu', array(
                            'items'       => Menu::getItems(Menu::POS_FOOTER_BOTTOM),
                            'htmlOptions' => array('class' => 'inline', 'rel' => "Nofollow"),
//                                    'id'          => 'main-menu'
                        ));
                        ?>
                    </div>
                    <!--<div class="clear"></div>-->
                    <div class="span4 copyright fl">
                        <?php echo Option::getItem('copyright') ?>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </footer>
        <script src="<?php echo $this->assetDir ?>/js/bootstrap.min.js"></script>
        <script src="<?php echo $this->assetDir ?>/js/caregoriesmenu.js"></script>
        <script src="<?php echo $this->assetDir . 'js/responsiveslides.min.js' ?>"></script>
        <script src="<?php echo $this->assetDir ?>/js/custom.js"></script>
        <!--js trang chi tiet san pham-->
        <script src="<?php echo $this->assetDir . 'js/lightbox/jquery.prettyPhoto.js' ?>"></script>
        <script src="<?php echo $this->assetDir . 'js/jcarousellite.js' ?>"></script>
        <!--JS Slide chân trang-->
        <script src="<?php echo $this->assetDir . 'js/bxslide/jquery.bxslider.js' ?>"></script>
        <script src="<?php echo $this->assetDir . 'js/bxslide/rainbow.min.js' ?>"></script>
        <script src="<?php echo $this->assetDir . 'js/bxslide/scripts.js' ?>"></script>
        <script type="text/javascript">
                            //                                    $(document).ready(function() {
                            $('.slider4').bxSlider({
                                auto: true,
                                pause: 4000,
                                slideWidth: 150,
                                minSlides: 7,
                                maxSlides: 7,
                                moveSlides: 1,
                                slideMargin: 10,
                                pager: false
                            });
                            $(".rslides").responsiveSlides();

                            //                                    });
        </script>
        <?php echo StatCounter::getCode(); ?>
    </body>
</html>